<template>
  <div class="goods-list-item" @click="itemClick">
    <img v-lazy="showImg" alt="" />
    <p>{{ goodsItem.price }}</p>
  </div>
</template>

<script>
export default {
  props: {
    goodsItem: {
      type: Object,
      default: {},
    },
  },
  computed: {
    showImg() {
      return this.goodsItem.image || this.goodsItem.show.img;
    },
  },
  methods: {
    itemClick() {
      this.$router.push("/detail/" + this.goodsItem.iid);
    },
  },
};
</script>

<style>
.goods-list-item {
  width: 46%;
  text-align: center;
}
.goods-list-item img {
  width: 100%;
  border-radius: 5px;
}
</style>